<%@ page import="java.util.List" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <link rel="icon" href="image/logo-index.png" type="image/x-icon">
    <title>wan.小说</title>
    <%
        if (request.getAttribute("backColor") != null) {
            request.getSession().setAttribute("css", request.getAttribute("backColor"));
        }
        if (request.getSession().getAttribute("css") == null) {
            request.getSession().setAttribute("css","css/back-normal.css");
        }
    %>
    <link rel="stylesheet" href=<%= request.getSession().getAttribute("css")%> type="text/css">
    <style>
        p{
            width: 900px;
        }
        body{
            font-size: 20px;
        }

        .fistp{
            position: absolute;
            right: 125px;
        }
        .bookd{
            position: absolute;
            right: 25px;
        }
        .protecte{
            position: absolute;
            right: 100px;
        }
        .downl{
            position: absolute;
            right: 25px;
        }
        .pre{
            position: absolute;
            left: 100px;
        }
        .next{
            position: absolute;
            right: 100px;
        }
    </style>
</head>
<body>
    <%
        if (!org.apache.commons.lang.StringUtils.isBlank((String) request.getSession().getAttribute("novelName"))) {
            request.setAttribute("h",request.getSession().getAttribute("novelName"));
        }else {
            request.setAttribute("h","WAN.小说网");
        }
    %>
    <table align="center">
        <tr>
            <td>
            <h1 style="text-align: center"><b><em><%=request.getAttribute("h")%></em></b></h1>
            </td>
            <td>
                <a href="find.jsp" class="fistp">首页</a>
            </td>
            <td>
                <a href="depository.jsp" class="bookd">本地书库</a>
            </td>
        </tr>
        <tr>
            <td>
                <form action="BackColorManage" class="protecte" method="post">
                    <input type="hidden" name="backColor" value="css/back-protectEye.css">
                    <input type="submit" value="护眼" style="font-size: 15px">
                </form>
            </td>
            <td>
                <form action="BackColorManage" class="downl" method="post">
                    <input type="hidden" name="backColor" value="css/back-downLight.css">
                    <input type="submit" value="关灯" style="font-size: 15px">
                </form>
            </td>
        </tr>
    </table>
        <%
            List<String> list = (List)request.getAttribute("novels");
            if (null != list) {
                if (list.size() != 0) {
                    for (int i = 0; i < list.size(); i++) {
        %>
    <table align="center">
        <tr>
            <td>
                <p><%=
                list.get(i)
                %></p>
            </td>
        </tr>
    </table>
        <%
            }
             }
              }
            if (null != request.getSession().getAttribute("novelName")) {
        %>

    <table>
        <tr>
            <form action="HelloNovel" method="post">
                <%
                    Object pageNum = request.getSession().getAttribute("pageNum");
                    if (null == pageNum || (int) pageNum < 3) {
                        request.setAttribute("hidden","hidden");
                    }else {
                        request.setAttribute("hidden","submit");
                    }
                    if ((int)pageNum > 0) {
                        request.setAttribute("ne","submit");
                    }else {
                        request.setAttribute("ne","hidden");
                    }
                %>
                <td class="pre">
                    <input type=<%= request.getAttribute("hidden")%> value="上一页" name="front" style="font-size: 20px">
                </td>
                <td class="next">
                    <input type=<%= request.getAttribute("ne")%> value="下一页" name="next" style="font-size: 20px">
                </td>
            </form>
        </tr>
    </table>
        <%
            }
        %>
</body>
</html>